<template>
  <div class="app-container">
    <el-dialog :title="title" :visible.sync="visible" width="900px" v-if="visible" append-to-body
      :close-on-click-modal="false">
      <el-table v-loading="loading" :data="tableList" stripe border>
        <el-table-column label="序号" align="center" type="index" width="64px" />
        <el-table-column label="权益名称" align="center" prop="name" :show-overflow-tooltip="true" />
        <el-table-column label="激活时间" align="center" prop="createTime" :show-overflow-tooltip="true" />
        <el-table-column label="哈希码" align="center" prop="code" :show-overflow-tooltip="true" />
      </el-table>
      <pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
        @pagination="getList"></pagination>
    </el-dialog>
  </div>
</template>

<script>
  import {
    historyEquityLs,
  } from "@/api/equityManager/equityCard";
  import ExportExcelButton from "@/components/ExportExcelButton/index";
  export default {
    // dicts: ['asset_card_type'],
    name: "Dialog",
    data() {
      return {
        labelWidth: '120px',
        inputWidth: '300px',
        id: '', //
        innerVisible: false,
        // 是否禁用表单
        disabled: false,
        // 弹出层标题
        title: "历史激活权益",
        // 是否显示弹出层
        visible: false,
        loading: false,
        // 总条数
        total: 0,
        // 数字权益卡列表表格数据
        tableList: [],
        // 查询参数
        queryParams: {
          pageNum: 1,
          pageSize: 10,
          id:'',
        }
      };
    },
    components: {
      ExportExcelButton
    },
    computed: {
      ExportParams() {
        const params = {
          ...this.queryParams,
        };
        return params;
      },
    },
    created() {

    },
    methods: {
      /** 打开发行管理弹框 */
      open(id) {
        this.queryParams.id = id
        this.getList()
        this.visible = true
      },
      // 取消按钮
      cancel() {
        this.visible = false;
        this.reset();
      },
      // 获取列表
      getList() {
        this.loading = true;
        historyEquityLs(this.queryParams).then(response => {
          this.tableList = response.result.records;
          this.total = response.result.total;
          console.log(this.total)
          this.loading = false;
        });
      },
    }
  };

</script>
<style scoped>
  .img_box {
    width: 100px;
    height: 70px;
    border-radius: 4px;
  }

</style>
